package mostWordsFound;

import java.util.Map;

public class SOlution {
    public int mostWordsFound(String[] sentences) {
        int ans = 0;
        for (int i = 0; i < sentences.length; i++) {
            ans = Math.max(ans,getCount(sentences[i]));
        }
        return ans;
    }
    private int getCount(String sentence) {
        int count = 0;
        for (int i = 0; i < sentence.length(); i++) {
            if(sentence.charAt(i) == ' '){
                count++;
            }
        }
        return count;
    }
}
